type = gdk_event_get_event_type (event);
if (type == GDK_ENTER_NOTIFY)
- g_signal_emit (controller, signals[ENTER], 0);
+ {
+ double x, y;
+ gdk_event_get_coords (event, &x, &y);
+ g_signal_emit (controller, signals[ENTER], 0, x, y);
+ }
else if (type == GDK_LEAVE_NOTIFY)
- g_signal_emit (controller, signals[LEAVE], 0);
+ {
+ g_signal_emit (controller, signals[LEAVE], 0);
+ }
else if (type == GDK_MOTION_NOTIFY)
{
double x, y;
/**
* GtkEventControllerMotion::enter:
* @controller: The object that received the signal
+ * @x: the x coordinate
+ * @y: the y coordinate
*
* Signals that the pointer has entered the widget.
*/
G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
NULL,
- G_TYPE_NONE, 0);
+ G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
+
/**
* GtkEventControllerMotion::leave:
* @controller: The object that received the signal
GTK_TYPE_EVENT_CONTROLLER_MOTION,
G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
- NULL,
+ NULL,
G_TYPE_NONE, 0);
/**
}
static void
-on_enter (GtkEventController *controller, GtkWidget *overlay)
+on_enter (GtkEventController *controller,
+ double x,
+ double y,
+ GtkWidget *overlay)
{
GtkWidget *child = gtk_event_controller_get_widget (controller);